package core;

import java.util.List;
import java.util.Map;

import core.domain.DataFile;
import core.domain.Part;
import core.domain.PeerDesciptor;
import core.domain.Torrent;

public interface ITransfersQueue {

	public void addSeedingTorrentToQueue(DataFile dataFile);
	
	public void addLeechingTorrentToQueue(Torrent torrent);
	
	public void removeTorrentFromQueue(Torrent torrent);
	
	public boolean addPartToTorrent(Torrent torrent, Part part);
	
	public Part getIthPartForTorrent(Torrent torrent, int index);
	
	public List<Integer> missingPartsFor(Torrent torrent);
	
	public List<Integer> arrivedPiecesFor(Torrent torrent);
	
	public Map<PeerDesciptor, List<Integer>> getAvailabilityForTorrent(Torrent torrent);
	
	public void addAvailability(Torrent torrent, PeerDesciptor peer, List<Integer> availableParts);
	
	public boolean isSeeding(Torrent torrent);
	
	public PeerDesciptor getRandomPeerForTorrent(Torrent torrentOfInterest, PeerDesciptor self);

	public Part getRandomMissingPartFromPeerForTorrent(PeerDesciptor randomPeerForTorrent, Torrent torrentOfInterest);
	
	public DataFile getCompleteDatafile(Torrent torrent);
}
